# -*- coding: utf-8 -*-

"""
Created on Thu Aug 12 11:07:05 2021

@author: wugui
"""
import re


phoneNumRegex = re.compile(r'\d\d\d-\d\d\d-\d\d\d\d')
mo = phoneNumRegex.search('My number is 415-000-1234')
print('Phone number found: ' + mo.group())


phoneNumRegex = re.compile(r'(\d\d\d)-(\d\d\d-\d\d\d\d)')
mo = phoneNumRegex.search('My number is 415-000-1234')
print('Phone number found: ' + mo.group(1))
